import 'package:flutter/material.dart';
import 'package:flutter_framework/utils/logs.dart';
import 'package:get/get.dart';

class TestRouterPathDetail extends StatefulWidget {
  const TestRouterPathDetail({super.key});

  @override
  State<TestRouterPathDetail> createState() => _TestRouterPathDetailState();
}

class _TestRouterPathDetailState extends State<TestRouterPathDetail> {
  String id = '';

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    Map<String, dynamic>? data = Get.parameters;
    if (data.isNotEmpty) {
      logs(data);
      setState(() {
        id = data['id']!;
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('path地址传参'),
      ),
      body: Center(
        child: Text('当前的id参数是: $id'),
      ),
    );
  }
}
